﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DCTLib.Common;

namespace DCTAccess.Business.News
{
    public class NewsControler
    {
        public static News GetNewsByID(int newID)
        {
            NewsFilter searchCriteria = new NewsFilter();
            searchCriteria.ProductID = newID;

            DataTable dtNews = searchCriteria.GetNews();
            if (ValidationHelper.HasRow(dtNews))
            {
                return new News(dtNews.Rows[0]);
            }
            else
            {
                return null;
            }
        }
    }
}
